package examples.color_picker.application ;

import divtastic.js.DisplayDiv ;
import divtastic.js.Divtastic ;
import divtastic.js.application.views.WindowView ;
import examples.color_picker.views.HexagonPickerView ;
import divtastic.js.application.views.ColorHexagon;


class Controller
{
    
    
    private var _holder :DisplayDiv;
    
    
    
    public function new( holder_: DisplayDiv )
    {
        
        _holder                 = holder_ ;
        
        var pickerWindowLight   = new Divtastic() ;
        
        _holder.addChild( pickerWindowLight ) ;
        
        var windowViewLight     = new WindowView(   pickerWindowLight
                                                ,   'Light Color Picker'
                                                ,   0
                                                ,   50
                                                ,   220
                                                ,   220
                                                ,   '#9d9e6a'
                                                ) ;
                                                
        new HexagonPickerView( pickerWindowLight, windowViewLight, ColorPallet.Light, ColorPallet.Light, 0x000000 ) ;
        
        var pickerWindowDark    = new Divtastic() ;
        
        _holder.addChild( pickerWindowDark ) ;
        
        var windowViewDark      = new WindowView(   pickerWindowDark
                                                ,   'Dark Color Picker'
                                                ,   300
                                                ,   50
                                                ,   220
                                                ,   220
                                                ,   '#9d9e6a'
                                                ) ;
                                                
        new HexagonPickerView( pickerWindowDark, windowViewDark, ColorPallet.Dark, ColorPallet.Dark, 0xFFFFFF ) ;
        
        
        var pickerWindowBoth    = new Divtastic() ;
        
        _holder.addChild( pickerWindowBoth ) ;
        
        var windowViewBoth      = new WindowView(   pickerWindowBoth
                                                ,   'Color Picker'
                                                ,   150
                                                ,   310
                                                ,   220
                                                ,   220
                                                ,   '#9d9e6a'
                                                ) ;
                                                
        new HexagonPickerView( pickerWindowBoth, windowViewBoth, ColorPallet.Dark, ColorPallet.Light, 0xcccccc ) ;
        
        
    }
    
    
}